/*
 * DependencyViewerView.java
 */

package dependencyviewer;

import dependencyviewer.controller.ImportController;
import dependencyviewer.model.Element;
import dependencyviewer.ui.GraphVisualizationLevel;
import edu.uci.ics.jung.algorithms.layout.CircleLayout;
import edu.uci.ics.jung.algorithms.layout.FRLayout;
import edu.uci.ics.jung.algorithms.layout.ISOMLayout;
import edu.uci.ics.jung.algorithms.layout.KKLayout;
import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.algorithms.layout.SpringLayout;
import edu.uci.ics.jung.algorithms.layout.SpringLayout2;
import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.ProgressMonitorInputStream;


/**
 * The application's main frame.
 */
public class DependencyViewerView extends FrameView {

    public DependencyViewerView(SingleFrameApplication app) {
        super(app);

        initComponents();

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = DependencyViewerApp.getApplication().getMainFrame();
            aboutBox = new DependencyViewerAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        DependencyViewerApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        graphVisualizationViewer = new dependencyviewer.ui.GraphVisualizationViewer();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        fileOpenMenuItem = new javax.swing.JMenuItem();
        exitMenutItemSeparator = new javax.swing.JPopupMenu.Separator();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        viewMenu = new javax.swing.JMenu();
        mouseModeTransformingRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        mouseModePickingRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        mouseSeparator = new javax.swing.JPopupMenu.Separator();
        springLayoutRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        spring2LayoutRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        circleLayoutRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        isomLayoutRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        kkLayoutRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        frLayoutRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        layoutSeparator = new javax.swing.JPopupMenu.Separator();
        packageRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        classRadioButtonMenuItem = new javax.swing.JRadioButtonMenuItem();
        levelSeparator = new javax.swing.JPopupMenu.Separator();
        filterCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem();
        autoRepaintCheckBoxMenuItem = new javax.swing.JCheckBoxMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        mouseModeButtonGroup = new javax.swing.ButtonGroup();
        layoutButtonGroup = new javax.swing.ButtonGroup();
        levelButtonGroup = new javax.swing.ButtonGroup();

        mainPanel.setName("mainPanel"); // NOI18N

        graphVisualizationViewer.setName("graphVisualizationViewer"); // NOI18N

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 664, Short.MAX_VALUE)
            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(graphVisualizationViewer, javax.swing.GroupLayout.DEFAULT_SIZE, 664, Short.MAX_VALUE))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 370, Short.MAX_VALUE)
            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addGap(33, 33, 33)
                    .addComponent(graphVisualizationViewer, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)))
        );

        menuBar.setName("menuBar"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(dependencyviewer.DependencyViewerApp.class).getContext().getActionMap(DependencyViewerView.class, this);
        fileMenu.setAction(actionMap.get("showFileOpen")); // NOI18N
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(dependencyviewer.DependencyViewerApp.class).getContext().getResourceMap(DependencyViewerView.class);
        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        fileOpenMenuItem.setAction(actionMap.get("showFileOpenDialog")); // NOI18N
        fileOpenMenuItem.setText(resourceMap.getString("fileOpenMenuItem.text")); // NOI18N
        fileOpenMenuItem.setName("fileOpenMenuItem"); // NOI18N
        fileMenu.add(fileOpenMenuItem);

        exitMenutItemSeparator.setName("exitMenutItemSeparator"); // NOI18N
        fileMenu.add(exitMenutItemSeparator);

        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        viewMenu.setText(resourceMap.getString("viewMenu.text")); // NOI18N
        viewMenu.setName("viewMenu"); // NOI18N

        mouseModeTransformingRadioButtonMenuItem.setAction(actionMap.get("mouseModeTransforming")); // NOI18N
        mouseModeButtonGroup.add(mouseModeTransformingRadioButtonMenuItem);
        mouseModeTransformingRadioButtonMenuItem.setSelected(true);
        mouseModeTransformingRadioButtonMenuItem.setText(resourceMap.getString("mouseModeTransformingRadioButtonMenuItem.text")); // NOI18N
        mouseModeTransformingRadioButtonMenuItem.setName("mouseModeTransformingRadioButtonMenuItem"); // NOI18N
        viewMenu.add(mouseModeTransformingRadioButtonMenuItem);

        mouseModePickingRadioButtonMenuItem.setAction(actionMap.get("mouseModePicking")); // NOI18N
        mouseModeButtonGroup.add(mouseModePickingRadioButtonMenuItem);
        mouseModePickingRadioButtonMenuItem.setText(resourceMap.getString("mouseModePickingRadioButtonMenuItem.text")); // NOI18N
        mouseModePickingRadioButtonMenuItem.setName("mouseModePickingRadioButtonMenuItem"); // NOI18N
        viewMenu.add(mouseModePickingRadioButtonMenuItem);

        mouseSeparator.setName("mouseSeparator"); // NOI18N
        viewMenu.add(mouseSeparator);

        springLayoutRadioButtonMenuItem.setAction(actionMap.get("springLayout")); // NOI18N
        layoutButtonGroup.add(springLayoutRadioButtonMenuItem);
        springLayoutRadioButtonMenuItem.setSelected(true);
        springLayoutRadioButtonMenuItem.setText(resourceMap.getString("springLayoutRadioButtonMenuItem.text")); // NOI18N
        springLayoutRadioButtonMenuItem.setName("springLayoutRadioButtonMenuItem"); // NOI18N
        viewMenu.add(springLayoutRadioButtonMenuItem);

        spring2LayoutRadioButtonMenuItem.setAction(actionMap.get("spring2Layout")); // NOI18N
        layoutButtonGroup.add(spring2LayoutRadioButtonMenuItem);
        spring2LayoutRadioButtonMenuItem.setText(resourceMap.getString("spring2LayoutRadioButtonMenuItem.text")); // NOI18N
        spring2LayoutRadioButtonMenuItem.setName("spring2LayoutRadioButtonMenuItem"); // NOI18N
        viewMenu.add(spring2LayoutRadioButtonMenuItem);

        circleLayoutRadioButtonMenuItem.setAction(actionMap.get("circleLayout")); // NOI18N
        layoutButtonGroup.add(circleLayoutRadioButtonMenuItem);
        circleLayoutRadioButtonMenuItem.setText(resourceMap.getString("circleLayoutRadioButtonMenuItem.text")); // NOI18N
        circleLayoutRadioButtonMenuItem.setName("circleLayoutRadioButtonMenuItem"); // NOI18N
        viewMenu.add(circleLayoutRadioButtonMenuItem);

        isomLayoutRadioButtonMenuItem.setAction(actionMap.get("isomLayout")); // NOI18N
        layoutButtonGroup.add(isomLayoutRadioButtonMenuItem);
        isomLayoutRadioButtonMenuItem.setText(resourceMap.getString("isomLayoutRadioButtonMenuItem.text")); // NOI18N
        isomLayoutRadioButtonMenuItem.setName("isomLayoutRadioButtonMenuItem"); // NOI18N
        viewMenu.add(isomLayoutRadioButtonMenuItem);

        kkLayoutRadioButtonMenuItem.setAction(actionMap.get("kkLayout")); // NOI18N
        layoutButtonGroup.add(kkLayoutRadioButtonMenuItem);
        kkLayoutRadioButtonMenuItem.setText(resourceMap.getString("kkLayoutRadioButtonMenuItem.text")); // NOI18N
        kkLayoutRadioButtonMenuItem.setName("kkLayoutRadioButtonMenuItem"); // NOI18N
        viewMenu.add(kkLayoutRadioButtonMenuItem);

        frLayoutRadioButtonMenuItem.setAction(actionMap.get("frLayout")); // NOI18N
        layoutButtonGroup.add(frLayoutRadioButtonMenuItem);
        frLayoutRadioButtonMenuItem.setText(resourceMap.getString("frLayoutRadioButtonMenuItem.text")); // NOI18N
        frLayoutRadioButtonMenuItem.setName("frLayoutRadioButtonMenuItem"); // NOI18N
        viewMenu.add(frLayoutRadioButtonMenuItem);

        layoutSeparator.setName("layoutSeparator"); // NOI18N
        viewMenu.add(layoutSeparator);

        levelButtonGroup.add(packageRadioButtonMenuItem);
        packageRadioButtonMenuItem.setSelected(true);
        packageRadioButtonMenuItem.setText(resourceMap.getString("packageRadioButtonMenuItem.text")); // NOI18N
        packageRadioButtonMenuItem.setName("packageRadioButtonMenuItem"); // NOI18N
        packageRadioButtonMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                packageRadioButtonMenuItemActionPerformed(evt);
            }
        });
        viewMenu.add(packageRadioButtonMenuItem);

        levelButtonGroup.add(classRadioButtonMenuItem);
        classRadioButtonMenuItem.setText(resourceMap.getString("classRadioButtonMenuItem.text")); // NOI18N
        classRadioButtonMenuItem.setName("classRadioButtonMenuItem"); // NOI18N
        classRadioButtonMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                classRadioButtonMenuItemActionPerformed(evt);
            }
        });
        viewMenu.add(classRadioButtonMenuItem);

        levelSeparator.setName("levelSeparator"); // NOI18N
        viewMenu.add(levelSeparator);

        filterCheckBoxMenuItem.setSelected(true);
        filterCheckBoxMenuItem.setText(resourceMap.getString("filterCheckBoxMenuItem.text")); // NOI18N
        filterCheckBoxMenuItem.setName("filterCheckBoxMenuItem"); // NOI18N
        filterCheckBoxMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                filterCheckBoxMenuItemActionPerformed(evt);
            }
        });
        viewMenu.add(filterCheckBoxMenuItem);
        filterCheckBoxMenuItem.getAccessibleContext().setAccessibleName(resourceMap.getString("filterCheckBoxMenuItem.AccessibleContext.accessibleName")); // NOI18N

        autoRepaintCheckBoxMenuItem.setSelected(true);
        autoRepaintCheckBoxMenuItem.setText(resourceMap.getString("autoRepaintCheckBoxMenuItem.text")); // NOI18N
        autoRepaintCheckBoxMenuItem.setName("autoRepaintCheckBoxMenuItem"); // NOI18N
        viewMenu.add(autoRepaintCheckBoxMenuItem);

        menuBar.add(viewMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 664, Short.MAX_VALUE)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 480, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void filterCheckBoxMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_filterCheckBoxMenuItemActionPerformed
        this.graphVisualizationViewer.setFilter(this.filterCheckBoxMenuItem.getState());
    }//GEN-LAST:event_filterCheckBoxMenuItemActionPerformed

    private void packageRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_packageRadioButtonMenuItemActionPerformed
        this.graphVisualizationViewer.setLevel(GraphVisualizationLevel.PACKAGE);
    }//GEN-LAST:event_packageRadioButtonMenuItemActionPerformed

    private void classRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_classRadioButtonMenuItemActionPerformed
        this.graphVisualizationViewer.setLevel(GraphVisualizationLevel.CLASS);
    }//GEN-LAST:event_classRadioButtonMenuItemActionPerformed

    @Action
    public void mouseModePicking() {
        this.graphVisualizationViewer.getGraphMouse().setMode(Mode.PICKING);
    }

    @Action
    public void mouseModeTransforming() {
        this.graphVisualizationViewer.getGraphMouse().setMode(Mode.TRANSFORMING);
    }

    @Action
    public void springLayout() {
        // This seems to be a bit ugly...
        // But because of the coupling between Layout and Graph there is no other way right now
        this.graphVisualizationViewer.setLayout( this.graphVisualizationViewer.new SetLayoutCommand() {
            @Override
            public Layout<Element, Number> getLayout() {
                return new SpringLayout(this.getGraph());
            }
        } );
    }

    @Action
    public void circleLayout() {
        this.graphVisualizationViewer.setLayout( this.graphVisualizationViewer.new SetLayoutCommand() {
            @Override
            public Layout<Element, Number> getLayout() {
                return new CircleLayout(this.getGraph());
            }
        } );
    }

    @Action
    public void isomLayout() {
        this.graphVisualizationViewer.setLayout( this.graphVisualizationViewer.new SetLayoutCommand() {
            @Override
            public Layout<Element, Number> getLayout() {
                return new ISOMLayout(this.getGraph());
            }
        } );
    }

    @Action
    public void spring2Layout() {
        this.graphVisualizationViewer.setLayout( this.graphVisualizationViewer.new SetLayoutCommand() {
            @Override
            public Layout<Element, Number> getLayout() {
                return new SpringLayout2(this.getGraph());
            }
        } );
    }

    @Action
    public void kkLayout() {
        this.graphVisualizationViewer.setLayout( this.graphVisualizationViewer.new SetLayoutCommand() {
            @Override
            public Layout<Element, Number> getLayout() {
                return new KKLayout(this.getGraph());
            }
        } );
    }

    @Action
    public void frLayout() {
        this.graphVisualizationViewer.setLayout( this.graphVisualizationViewer.new SetLayoutCommand() {
            @Override
            public Layout<Element, Number> getLayout() {
                return new FRLayout(this.getGraph());
            }
        } );
    }

    @Action
    public void showFileOpenDialog() {
        final JFileChooser fileChooser = new JFileChooser(".");
        int status = fileChooser.showOpenDialog(this.getComponent());
        if (JFileChooser.APPROVE_OPTION == status) {
            final ImportController ic = new ImportController(fileChooser.getSelectedFile());
            this.graphVisualizationViewer.setContentProvider(ic.getContentProvider());
            this.statusMessageLabel.setText("File: " + fileChooser.getSelectedFile().getAbsolutePath());
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBoxMenuItem autoRepaintCheckBoxMenuItem;
    private javax.swing.JRadioButtonMenuItem circleLayoutRadioButtonMenuItem;
    private javax.swing.JRadioButtonMenuItem classRadioButtonMenuItem;
    private javax.swing.JPopupMenu.Separator exitMenutItemSeparator;
    private javax.swing.JMenuItem fileOpenMenuItem;
    private javax.swing.JCheckBoxMenuItem filterCheckBoxMenuItem;
    private javax.swing.JRadioButtonMenuItem frLayoutRadioButtonMenuItem;
    private dependencyviewer.ui.GraphVisualizationViewer graphVisualizationViewer;
    private javax.swing.JRadioButtonMenuItem isomLayoutRadioButtonMenuItem;
    private javax.swing.JRadioButtonMenuItem kkLayoutRadioButtonMenuItem;
    private javax.swing.ButtonGroup layoutButtonGroup;
    private javax.swing.JPopupMenu.Separator layoutSeparator;
    private javax.swing.ButtonGroup levelButtonGroup;
    private javax.swing.JPopupMenu.Separator levelSeparator;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.ButtonGroup mouseModeButtonGroup;
    private javax.swing.JRadioButtonMenuItem mouseModePickingRadioButtonMenuItem;
    private javax.swing.JRadioButtonMenuItem mouseModeTransformingRadioButtonMenuItem;
    private javax.swing.JPopupMenu.Separator mouseSeparator;
    private javax.swing.JRadioButtonMenuItem packageRadioButtonMenuItem;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JRadioButtonMenuItem spring2LayoutRadioButtonMenuItem;
    private javax.swing.JRadioButtonMenuItem springLayoutRadioButtonMenuItem;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JMenu viewMenu;
    // End of variables declaration//GEN-END:variables

    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

    private JDialog aboutBox;

}
